package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AccountTransferMapper;
import com.ruoyi.system.domain.AccountTransfer;
import com.ruoyi.system.service.IAccountTransferService;
import com.ruoyi.common.core.text.Convert;

/**
 * 转出Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-07
 */
@Service
public class AccountTransferServiceImpl implements IAccountTransferService 
{
    @Autowired
    private AccountTransferMapper accountTransferMapper;

    /**
     * 查询转出
     * 
     * @param id 转出主键
     * @return 转出
     */
    @Override
    public AccountTransfer selectAccountTransferById(Long id)
    {
        return accountTransferMapper.selectAccountTransferById(id);
    }

    /**
     * 查询转出列表
     * 
     * @param accountTransfer 转出
     * @return 转出
     */
    @Override
    public List<AccountTransfer> selectAccountTransferList(AccountTransfer accountTransfer)
    {
        return accountTransferMapper.selectAccountTransferList(accountTransfer);
    }

    /**
     * 新增转出
     * 
     * @param accountTransfer 转出
     * @return 结果
     */
    @Override
    public int insertAccountTransfer(AccountTransfer accountTransfer)
    {
        accountTransfer.setCreateTime(DateUtils.getNowDate());
        return accountTransferMapper.insertAccountTransfer(accountTransfer);
    }

    /**
     * 修改转出
     * 
     * @param accountTransfer 转出
     * @return 结果
     */
    @Override
    public int updateAccountTransfer(AccountTransfer accountTransfer)
    {
        return accountTransferMapper.updateAccountTransfer(accountTransfer);
    }

    /**
     * 批量删除转出
     * 
     * @param ids 需要删除的转出主键
     * @return 结果
     */
    @Override
    public int deleteAccountTransferByIds(String ids)
    {
        return accountTransferMapper.deleteAccountTransferByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除转出信息
     * 
     * @param id 转出主键
     * @return 结果
     */
    @Override
    public int deleteAccountTransferById(Long id)
    {
        return accountTransferMapper.deleteAccountTransferById(id);
    }
}
